//
//  FPCinemaDetailView.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/21.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

#import "FPCinemaDetailView.h"

@implementation FPCinemaDetailView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self B_TopView];
    }
    return self;
}

- (void)B_TopView
{
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    self.scrollView.contentSize = CGSizeMake(0, kScreenHeight);
    [self addSubview:_scrollView];
    
    UIImageView *imageView = [self lurImageView];
    [_scrollView addSubview:imageView];
    
    self.topImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, kImageH(64), kScreenWidth, kImageH(80))];
    self.topImageView.backgroundColor = [UIColor clearColor];
    self.topImageView.image = [UIImage imageNamed:@"water_sep"];
    [_scrollView addSubview:_topImageView];
    
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, kImageH(64), kImageW(100), kImageH(100))];
    self.iconImageView.layer.borderWidth = 1.0;
    self.iconImageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    [_scrollView addSubview:_iconImageView];
    
    self.cinemaNameLabel = [UILabel labelWithFrame:CGRectMake(kImageW(125), kImageH(70), kImageW(kScreenWidth - kImageW(140)), 30) text:@"上海米格国际影城" fontSize:18.0 fontWeight:1.0 color:[UIColor yellowColor]];
    [_scrollView addSubview:_cinemaNameLabel];
    
    self.numberCinemaLabel = [UILabel labelWithFrame:CGRectMake(kImageW(290), kImageH(120), 30, kImageH(20)) text:@"9" color:[UIColor colorWithRed:1.000 green:0.737 blue:0.117 alpha:1.000]];
    [_scrollView addSubview:_numberCinemaLabel];
    
    UIImageView *heartImageView = [[UIImageView alloc] initWithFrame:CGRectMake(kImageW(310), kImageH(70), 50, 50)];
    heartImageView.image = [UIImage imageNamed:@"icon_heart"];
    [_scrollView addSubview:heartImageView];
    
    self.ratingLabel = [UILabel labelWithFrame:CGRectMake(kImageW(8), kImageH(3), 40, 40) text:@"73%" fontSize:14.0 fontWeight:1.0 color:[UIColor whiteColor]];
    [heartImageView addSubview:_ratingLabel];
    
    UILabel *label = [UILabel labelWithFrame:CGRectMake(kImageW(320), kImageH(120), 50,kImageH(20)) text:@"个影厅" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [_scrollView addSubview:label];
    
    self.filmResulLabel = [UILabel labelWithFrame:CGRectMake(kImageW(200), kImageH(140), kImageW(90), kImageH(24)) text:@"观影效果:--" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [_scrollView addSubview:_filmResulLabel];
    
    self.filmQualityLabel = [UILabel labelWithFrame:CGRectMake(kImageW(290), kImageH(140), kImageW(90), kImageH(24)) text:@"服务质量:--" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [_scrollView addSubview:_filmQualityLabel];
    
    //    self.markButton = [UIButton buttonWithType:UIButtonTypeSystem];
    //    self.markButton.frame = CGRectMake(50, kImageH(170), kScreenWidth - 100, 30);
    //    [self.markButton setTitle:@"我要评分" forState:UIControlStateNormal];
    //    [self.markButton setTintColor:[UIColor redColor]];
    //    self.markButton.layer.cornerRadius = 15.0;
    //    self.markButton.layer.borderWidth = 2.0;
    //    self.markButton.layer.borderColor = [UIColor redColor].CGColor;
    //    [_scrollView addSubview:_markButton];
    
    self.addressImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, kImageH(190), 30, 30)];
    self.addressImageView.image = [UIImage imageNamed:@"globe-vector"];
    [_scrollView addSubview:_addressImageView];
    
    self.addressLabel = [UILabel labelWithFrame:CGRectMake(60, kImageH(190), kScreenWidth - 100, 20) text:@"上海市青浦区嘉松中路5999弄51号" fontSize:14.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [_scrollView addSubview:_addressLabel];
    
    /*
     UIView *view = [[UIView alloc] initWithFrame:CGRectMake(kScreenWidth - 60, kImageH(180), 2, 50)];
     view.backgroundColor = [UIColor lightGrayColor];
     [_scrollView addSubview:view];
     
     self.gotoThereImageView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 55, kImageH(180), 40, 30)];
     self.gotoThereImageView.image = [UIImage imageNamed:@"right-arrow-vector"];
     self.gotoThereImageView.userInteractionEnabled = YES;
     [_scrollView addSubview:_gotoThereImageView];
     
     UILabel *gotoLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - 55, kImageH(210), 40, 20)];
     gotoLabel.text = @"到这去";
     gotoLabel.textColor = [UIColor colorWithRed:0.292 green:0.693 blue:0.704 alpha:1.000];
     gotoLabel.font = [UIFont systemFontOfSize:12.0];
     [_scrollView addSubview:gotoLabel];
     */
    
    UIView *sepView = [[UIView alloc] initWithFrame:CGRectMake( 60, kImageH(250), kScreenWidth - 60, 1)];
    sepView.backgroundColor = [UIColor lightGrayColor];
    [_scrollView addSubview:sepView];
    
    self.telImageView = [[UIImageView alloc]initWithFrame:CGRectMake(15, kImageH(260), 30, 30)];
    self.telImageView.image = [UIImage imageNamed:@"phone-vector"];
    [_scrollView addSubview:_telImageView];
    
    self.telLabel = [UILabel labelWithFrame:CGRectMake(60, kImageH(265), kScreenWidth - 150, 20) text:@"021-39293330" fontSize:14.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    self.telLabel.userInteractionEnabled = YES;
    [_scrollView addSubview:_telLabel];
    
    UIView *hightView = [[UIView alloc] initWithFrame:CGRectMake(0, kImageH(310), kScreenWidth, 10)];
    hightView.backgroundColor = [UIColor lightGrayColor];
    [_scrollView addSubview:hightView];
}

// 设置模糊背景
- (UIImageView *)lurImageView
{
    UIImageView *backImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, -64, kScreenWidth, kImageH(224))];
    backImage.image = [UIImage imageNamed:@"step.jpg"];
    backImage.userInteractionEnabled = YES;
    UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
    visualEffectView.frame = backImage.bounds;
    visualEffectView.alpha = 0.7;
    [backImage addSubview:visualEffectView];
    return backImage;
    
}

/*
 
 UIImageView *topImageView;
 UIImageView *iconImageView;
 UILabel *cinemaNameLabel;
 UILabel *numberCinemaLabel;
 UILabel *filmResulLabel;
 UILabel *filmQualityLabel;
 UIButton *markButton;
 UILabel *addressLabel;
 UIImageView *addressImageView;
 UIImageView *gotoThereImageView;
 UIImageView *telImageView;
 UILabel *telLabel;
 */

@end
